//
// UPointLight.java
// Copyright (C) 2010  "Naush" <naush _ hotmail _ fr>
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program.  If not, see <http://www.gnu.org/licenses/>./* ----------------------------------------------------------------------------







package org.ryzom.nel.threed;

import org.ryzom.nel.misc.CRGBA;
import org.ryzom.nel.misc.CVector;

public class UPointLight {
  private long swigCPtr;
  protected boolean swigCMemOwn;

  public UPointLight(long cPtr, boolean cMemoryOwn) {
    swigCMemOwn = cMemoryOwn;
    swigCPtr = cPtr;
  }

  public static long getCPtr(UPointLight obj) {
    return (obj == null) ? 0 : obj.swigCPtr;
  }

  protected void finalize() {
    delete();
  }

  public synchronized void delete() {
    if (swigCPtr != 0) {
      if (swigCMemOwn) {
        swigCMemOwn = false;
        nel3dJNI.delete_UPointLight(swigCPtr);
      }
      swigCPtr = 0;
    }
  }

  public void setAmbient(CRGBA ambient) {
    nel3dJNI.UPointLight_setAmbient(swigCPtr, this, CRGBA.getCPtr(ambient), ambient);
  }

  public void setDiffuse(CRGBA diffuse) {
    nel3dJNI.UPointLight_setDiffuse(swigCPtr, this, CRGBA.getCPtr(diffuse), diffuse);
  }

  public void setSpecular(CRGBA specular) {
    nel3dJNI.UPointLight_setSpecular(swigCPtr, this, CRGBA.getCPtr(specular), specular);
  }

  public void setColor(CRGBA color) {
    nel3dJNI.UPointLight_setColor(swigCPtr, this, CRGBA.getCPtr(color), color);
  }

  public CRGBA getAmbient() {
    return new CRGBA(nel3dJNI.UPointLight_getAmbient(swigCPtr, this), true);
  }

  public CRGBA getDiffuse() {
    return new CRGBA(nel3dJNI.UPointLight_getDiffuse(swigCPtr, this), true);
  }

  public CRGBA getSpecular() {
    return new CRGBA(nel3dJNI.UPointLight_getSpecular(swigCPtr, this), true);
  }

  public void setupAttenuation(float attenuationBegin, float attenuationEnd) {
    nel3dJNI.UPointLight_setupAttenuation(swigCPtr, this, attenuationBegin, attenuationEnd);
  }

  public float getAttenuationBegin() {
    return nel3dJNI.UPointLight_getAttenuationBegin(swigCPtr, this);
  }

  public float getAttenuationEnd() {
    return nel3dJNI.UPointLight_getAttenuationEnd(swigCPtr, this);
  }

  public void enableSpotlight(boolean enable) {
    nel3dJNI.UPointLight_enableSpotlight(swigCPtr, this, enable);
  }

  public boolean isSpotlight() {
    return nel3dJNI.UPointLight_isSpotlight(swigCPtr, this);
  }

  public void setupSpotAngle(float spotAngleBegin, float spotAngleEnd) {
    nel3dJNI.UPointLight_setupSpotAngle(swigCPtr, this, spotAngleBegin, spotAngleEnd);
  }

  public float getSpotAngleBegin() {
    return nel3dJNI.UPointLight_getSpotAngleBegin(swigCPtr, this);
  }

  public float getSpotAngleEnd() {
    return nel3dJNI.UPointLight_getSpotAngleEnd(swigCPtr, this);
  }

  public void setDeltaPosToSkeletonWhenOutOfFrustum(CVector deltaPos) {
    nel3dJNI.UPointLight_setDeltaPosToSkeletonWhenOutOfFrustum(swigCPtr, this, CVector.getCPtr(deltaPos), deltaPos);
  }

  public CVector getDeltaPosToSkeletonWhenOutOfFrustum() {
    return new CVector(nel3dJNI.UPointLight_getDeltaPosToSkeletonWhenOutOfFrustum(swigCPtr, this), false);
  }

  public void setInfluenceLightMap(boolean enable) {
    nel3dJNI.UPointLight_setInfluenceLightMap(swigCPtr, this, enable);
  }

  public boolean getInfluenceLightMap() {
    return nel3dJNI.UPointLight_getInfluenceLightMap(swigCPtr, this);
  }

  public UPointLight() {
    this(nel3dJNI.new_UPointLight__SWIG_0(), true);
  }

  public UPointLight(CPointLightModel object) {
    this(nel3dJNI.new_UPointLight__SWIG_1(CPointLightModel.getCPtr(object), object), true);
  }

  public void attach(CPointLightModel object) {
    nel3dJNI.UPointLight_attach(swigCPtr, this, CPointLightModel.getCPtr(object), object);
  }

  public void detach() {
    nel3dJNI.UPointLight_detach(swigCPtr, this);
  }

  public boolean empty() {
    return nel3dJNI.UPointLight_empty(swigCPtr, this);
  }

  public CPointLightModel getObjectPtr() {
    long cPtr = nel3dJNI.UPointLight_getObjectPtr(swigCPtr, this);
    return (cPtr == 0) ? null : new CPointLightModel(cPtr, false);
  }

}
